<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>舆情监控系统 - 注册</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/style.css') }}">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body class="bg-light">
    <div class="container">
        <div class="row justify-content-center mt-5">
            <div class="col-md-6">
                <div class="card shadow">
                    <div class="card-header bg-primary text-white text-center">
                        <h4>舆情监控系统</h4>
                    </div>
                    <div class="card-body">
                        <h5 class="card-title text-center mb-4">用户注册</h5>
                        
                        {% with messages = get_flashed_messages(with_categories=true) %}
                            {% if messages %}
                                {% for category, message in messages %}
                                    <div class="alert alert-{{ category }}">{{ message }}</div>
                                {% endfor %}
                            {% endif %}
                        {% endwith %}
                        
                        <form method="POST" action="{{ url_for('auth.register') }}">
                            {{ form.hidden_tag() }}
                            <div class="mb-3">
                                <label for="username" class="form-label">用户名</label>
                                {{ form.username(class="form-control", id="username", placeholder="请输入用户名") }}
                                {% if form.username.errors %}
                                    <div class="text-danger">
                                        {% for error in form.username.errors %}
                                            <small>{{ error }}</small>
                                        {% endfor %}
                                    </div>
                                {% endif %}
                            </div>
                            <div class="mb-3">
                                <label for="email" class="form-label">邮箱</label>
                                {{ form.email(class="form-control", id="email", placeholder="请输入邮箱") }}
                                {% if form.email.errors %}
                                    <div class="text-danger">
                                        {% for error in form.email.errors %}
                                            <small>{{ error }}</small>
                                        {% endfor %}
                                    </div>
                                {% endif %}
                            </div>
                            <div class="mb-3">
                                <label for="password" class="form-label">密码</label>
                                {{ form.password(class="form-control", id="password", placeholder="请输入密码") }}
                                {% if form.password.errors %}
                                    <div class="text-danger">
                                        {% for error in form.password.errors %}
                                            <small>{{ error }}</small>
                                        {% endfor %}
                                    </div>
                                {% endif %}
                            </div>
                            <div class="mb-3">
                                <label for="confirm_password" class="form-label">确认密码</label>
                                {{ form.confirm_password(class="form-control", id="confirm_password", placeholder="请再次输入密码") }}
                                {% if form.confirm_password.errors %}
                                    <div class="text-danger">
                                        {% for error in form.confirm_password.errors %}
                                            <small>{{ error }}</small>
                                        {% endfor %}
                                    </div>
                                {% endif %}
                            </div>
                            <div class="d-grid gap-2">
                                {{ form.submit(class="btn btn-primary") }}
                            </div>
                        </form>
                    </div>
                    <div class="card-footer text-center">
                        <p class="mb-0">已有账号？ <a href="{{ url_for('auth.login') }}">立即登录</a></p>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html> 